package org.sixtythousand.joker.util;

/** 维护组件的生命周期
 * @author zhoulk
 * @date 2023/10/11 10:28
 * @desc
 */
public interface LifeCycle {

    void start();

    void stop();

    boolean isRunning();

    boolean isStarted();

    boolean isStarting();

    boolean isStopping();

    boolean isStopped();

    boolean isFailed();

    String getState();

    enum State
    {
        STOPPED,
        STARTING,
        STARTED,
        STOPPING,
        FAILED
    }
}
